package com.byq.mm.common.engine;

import org.jivesoftware.smack.XMPPConnection;


import com.byq.mm.abstractx.cluster.server.executor.ExecutorManager;
import com.byq.mm.abstractx.engine.AccountManager;
import com.byq.mm.abstractx.engine.DefinationProcessor;
import com.byq.mm.abstractx.engine.ExtensionManager;
import com.byq.mm.abstractx.engine.InteractionProcessor;
import com.byq.mm.common.event.EventCenter;
import  com.byq.mm.common.engine.listener.ListenerManager;

public class XmppEngine implements Environment{
	ConnectionManager connectionManager;
	SmartStore liteStore;
	EventCenter eventCenter;
	AccountManager accountManager;
	ContactManager contactManager;
	public ContactManager getContactManager() {
		return contactManager;
	}
	public ConnectionManager getConnectionManager() {
		return connectionManager;
	}
	public SmartStore getLiteStore() {
		return liteStore;
	}
	public EventCenter getEventCenter() {
		return eventCenter;
	}
	public AccountManager getAccountManager() {
		return accountManager;
	}

	public ListenerManager getListenerManager() {
		return ListenerManager;
	}
	public ExecutorManager getExecutorManager() {
		return executorManager;
	}
	public DefinationProcessor getDefinationProcessor() {
		return definationProcessor;
	}
	public InteractionProcessor getInteractionProcessor() {
		return interactionProcessor;
	}
	ExtensionManager extensionManager;
	ListenerManager ListenerManager;
	ExecutorManager executorManager;
	DefinationProcessor definationProcessor;
	InteractionProcessor interactionProcessor;
	public XmppEngine(SmartStore store, AccountManager am, EventCenter ec){
		
		liteStore = store;
		connectionManager = new ConnectionManager(this);

		eventCenter = ec;
		accountManager  = am;
		extensionManager = new XmppExtensionManager(this);
		ListenerManager = new ListenerManager(this);
		contactManager = new ContactManager(this);
		executorManager = new ExecutorManager();

	}
	public ExtensionManager getExtensionManager() {
		return extensionManager;
	}
	public void setDefinationProcessor(DefinationProcessor definationProcessor) {
		this.definationProcessor = definationProcessor;
	}
	public void setInteractionProcessor(InteractionProcessor interactionProcessor) {
		this.interactionProcessor = interactionProcessor;
	}
	@Override
	public XMPPConnection getConnection() {
		// TODO Auto-generated method stub
		return connectionManager.getConnection();
	}
	

}
